package com.itheima.io1.mytest;

import java.io.*;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

/**
 * @author zhangbaiyan
 * @date 2024-09-21 17:54
 * @description:
 * @version:
 */
public class test8 {
    public static void main(String[] args) throws IOException {
//        OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("l.txt"), "GBK");
//        //写出数据
//        osw.write("你们好 啊");
//        //关闭流
//        osw.close();

        FileWriter fw = new FileWriter("l.txt", Charset.forName("GBK"));
//        FileWriter fw = new FileWriter("l.txt", StandardCharsets.UTF_8);
        //写入数据
        fw.write("你好啊");
        //关闭流
        fw.close();
    }
}
